//==============================================================================
//  Copyright 2011 Meta Watch Ltd. - http://www.MetaWatch.org/
// 
//  Licensed under the Meta Watch License, Version 1.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//  
//      http://www.MetaWatch.org/licenses/license-1.0.html
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//==============================================================================

/******************************************************************************/
/*! \file Fonts.c
*
* Fonts for the LCD version
*/
/******************************************************************************/

#include "Fonts.h"
#include "DebugUart.h"

/*! The number of printable characters in the font tables */
#define PRINTABLE_CHARACTERS ( 94 )

const unsigned char MetaWatch5table[PRINTABLE_CHARACTERS][5];
const unsigned char MetaWatch7table[PRINTABLE_CHARACTERS][7];
const unsigned int MetaWatch16table[PRINTABLE_CHARACTERS][16];

const unsigned char MetaWatch5width[PRINTABLE_CHARACTERS];
const unsigned char MetaWatch7width[PRINTABLE_CHARACTERS];
const unsigned char MetaWatch16width[PRINTABLE_CHARACTERS];

/*! Font Structure
 *
 * \param Type is the enumerated type of font
 * \param Height
 * \param Spacing is the horizontal spacing that should be inserted when
 * drawing characters
 */
typedef struct
{
  etFontType Type;
  unsigned char Height;
  unsigned char Spacing;
  
} tFont;

static tFont CurrentFont;

void SetFont(etFontType Type)
{
  switch (Type)
  {
  case MetaWatch5:
    CurrentFont.Type = Type;
    CurrentFont.Height = 5;
    CurrentFont.Spacing = 1;
    break;
  
  case MetaWatch7:
    CurrentFont.Type = Type;
    CurrentFont.Height = 7;
    CurrentFont.Spacing = 1;
    break;
  
  case MetaWatch16:
    CurrentFont.Type = Type;
    CurrentFont.Height = 16;
    CurrentFont.Spacing = 1;
    break;
    
  default:
    PrintString("Undefined Font Selected\r\n");
    break;
  }  
}

unsigned char MapDigitToIndex(unsigned char Digit)
{
  /* default is a space (the first printable character) */
  unsigned char Result = 0;

  if ( Digit < 10 )
  {
    Result = Digit + 0x10;  
  }
  
  return Result;
  
};


unsigned char GetCharacterWidth(unsigned char Character)
{ 
  unsigned char index = MapCharacterToIndex(Character);
  unsigned char Width = 0;
  
  switch (CurrentFont.Type)
  {
  case MetaWatch5:  Width = MetaWatch5width[index];  break;
  case MetaWatch7:  Width = MetaWatch7width[index];  break;
  case MetaWatch16: Width = MetaWatch16width[index]; break;
  default : 
    break;
  }
  
  return Width;
  
}

unsigned char GetCharacterHeight(void)
{
  return CurrentFont.Height;  
}

void SetFontSpacing(unsigned char Spacing)
{
  CurrentFont.Spacing = Spacing;  
}

unsigned char GetFontSpacing(void)
{
  return CurrentFont.Spacing;  
}

unsigned char MapCharacterToIndex(unsigned char CharIn)
{
  unsigned char Result = 0;

  // space = 0x20 and 0x7f = delete character
  if ( (CharIn >= 0x20) && (CharIn < 0x7f) )
  {
    Result = CharIn - 0x20;
  }
  
  return Result;
  
}


void GetCharacterBitmap(unsigned char Character,unsigned int * pBitmap)
{
  unsigned char index = MapCharacterToIndex(Character);

  for (unsigned char row = 0; row < CurrentFont.Height; row++ )
  {
    switch (CurrentFont.Type)
    {
    case MetaWatch5:
      pBitmap[row] = (unsigned int)MetaWatch5table[index][row];  
      break;
  
    case MetaWatch7:
      pBitmap[row] = (unsigned int)MetaWatch7table[index][row];  
      break;
  
    case MetaWatch16:
      pBitmap[row] = MetaWatch16table[index][row];  
      break;
  
    default:
      break;
    }
  
  }

}

const unsigned char MetaWatch5table[PRINTABLE_CHARACTERS][5] = 
{
  /* character 0x20 (' '): (width = 2) */
  0x00, 0x00, 0x00, 0x00, 0x00,
  
  /* character 0x21 ('!'): (width=1) */
  0x01, 0x01, 0x01, 0x00, 0x01, 
  
  /* character 0x22 ('"'): (width=3) */
  0x05, 0x05, 0x00, 0x00, 0x00, 
  
  /* character 0x23 ('#'): (width=5) */
  0x0A, 0x1F, 0x0A, 0x1F, 0x0A, 
  
  /* character 0x24 ('$'): (width=3) */
  0x00, 0x00, 0x00, 0x00, 0x00, 
  
  /* character 0x25 ('%'): (width=3) */
  0x00, 0x00, 0x00, 0x00, 0x00, 
  
  /* character 0x26 ('&'): (width=5) */
  0x02, 0x05, 0x16, 0x09, 0x1E, 
  
  /* character 0x27 ('''): (width=1) */
  0x01, 0x01, 0x00, 0x00, 0x00, 
  
  /* character 0x28 ('('): (width=2) */
  0x02, 0x01, 0x01, 0x01, 0x02, 
  
  /* character 0x29 (')'): (width=2) */
  0x01, 0x02, 0x02, 0x02, 0x01, 
  
  /* character 0x2A ('*'): (width=5) */
  0x0A, 0x04, 0x1F, 0x04, 0x0A, 
  
  /* character 0x2B ('+'): (width=5) */
  0x04, 0x04, 0x1F, 0x04, 0x04, 
  
  /* character 0x2C (','): (width=1) */
  0x00, 0x00, 0x00, 0x01, 0x01, 
  
  /* character 0x2D ('-'): (width=3) */
  0x00, 0x00, 0x07, 0x00, 0x00, 
  
  /* character 0x2E ('.'): (width=1) */
  0x00, 0x00, 0x00, 0x00, 0x01, 
  
  /* character 0x2F ('/'): (width=5) */
  0x10, 0x08, 0x04, 0x02, 0x01, 
  
  /* character 0x30 ('0'): (width=4) */
  0x06, 0x09, 0x09, 0x09, 0x06, 
  
  /* character 0x31 ('1'): (width=3) */
  0x03, 0x02, 0x02, 0x02, 0x07, 
  
  /* character 0x32 ('2'): (width=4) */
  0x06, 0x09, 0x04, 0x02, 0x0F, 
  
  /* character 0x33 ('3'): (width=4) */
  0x0F, 0x08, 0x06, 0x08, 0x07, 
  
  /* character 0x34 ('4'): (width=4) */
  0x04, 0x06, 0x05, 0x0F, 0x04, 
  
  /* character 0x35 ('5'): (width=4) */
  0x0F, 0x01, 0x0F, 0x08, 0x07, 
  
  /* character 0x36 ('6'): (width=4) */
  0x06, 0x01, 0x07, 0x09, 0x06, 
  
  /* character 0x37 ('7'): (width=4) */
  0x0F, 0x08, 0x04, 0x02, 0x02, 
  
  /* character 0x38 ('8'): (width=4) */
  0x06, 0x09, 0x06, 0x09, 0x06, 
  
  /* character 0x39 ('9'): (width=4) */
  0x06, 0x09, 0x0E, 0x08, 0x06, 
  
  /* character 0x3A (':'): (width=1) */
  0x00, 0x01, 0x00, 0x01, 0x00, 
  
  /* character 0x3B (';'): (width=2) */
  0x00, 0x02, 0x00, 0x02, 0x01, 
  
  /* character 0x3C ('<'): (width=3) */
  0x04, 0x02, 0x01, 0x02, 0x04, 
  
  /* character 0x3D ('='): (width=4) */
  0x00, 0x0F, 0x00, 0x0F, 0x00, 
  
  /* character 0x3E ('>'): (width=3) */
  0x01, 0x02, 0x04, 0x02, 0x01, 
  
  /* character 0x3F ('?'): (width=3) */
  0x03, 0x04, 0x02, 0x00, 0x02, 
  
  /* character 0x40 ('@'): (width=3) */
  0x00, 0x00, 0x00, 0x00, 0x00, 
  
  /* character 0x41 ('A'): (width=5) */
  0x04, 0x04, 0x0A, 0x0E, 0x11, 
  
  /* character 0x42 ('B'): (width=4) */
  0x07, 0x09, 0x07, 0x09, 0x07, 
  
  /* character 0x43 ('C'): (width=4) */
  0x06, 0x09, 0x01, 0x09, 0x06, 
  
  /* character 0x44 ('D'): (width=4) */
  0x07, 0x09, 0x09, 0x09, 0x07, 
  
  /* character 0x45 ('E'): (width=4) */
  0x0F, 0x01, 0x07, 0x01, 0x0F, 
  
  /* character 0x46 ('F'): (width=4) */
  0x0F, 0x01, 0x07, 0x01, 0x01, 
  
  /* character 0x47 ('G'): (width=4) */
  0x06, 0x01, 0x0D, 0x09, 0x06, 
  
  /* character 0x48 ('H'): (width=4) */
  0x09, 0x09, 0x0F, 0x09, 0x09, 
  
  /* character 0x49 ('I'): (width=3) */
  0x07, 0x02, 0x02, 0x02, 0x07, 
  
  /* character 0x4A ('J'): (width=4) */
  0x08, 0x08, 0x08, 0x09, 0x06, 
  
  /* character 0x4B ('K'): (width=4) */
  0x09, 0x05, 0x03, 0x05, 0x09, 
  
  /* character 0x4C ('L'): (width=4) */
  0x01, 0x01, 0x01, 0x01, 0x0F, 
  
  /* character 0x4D ('M'): (width=5) */
  0x11, 0x1B, 0x15, 0x11, 0x11, 
  
  /* character 0x4E ('N'): (width=5) */
  0x11, 0x13, 0x15, 0x19, 0x11, 
  
  /* character 0x4F ('O'): (width=4) */
  0x06, 0x09, 0x09, 0x09, 0x06, 
  
  /* character 0x50 ('P'): (width=4) */
  0x07, 0x09, 0x07, 0x01, 0x01, 
  
  /* character 0x51 ('Q'): (width=5) */
  0x06, 0x09, 0x09, 0x09, 0x1E, 
  
  /* character 0x52 ('R'): (width=4) */
  0x07, 0x09, 0x07, 0x09, 0x09, 
  
  /* character 0x53 ('S'): (width=4) */
  0x0E, 0x01, 0x06, 0x08, 0x07, 
  
  /* character 0x54 ('T'): (width=3) */
  0x07, 0x02, 0x02, 0x02, 0x02, 
  
  /* character 0x55 ('U'): (width=4) */
  0x09, 0x09, 0x09, 0x09, 0x06, 
  
  /* character 0x56 ('V'): (width=5) */
  0x11, 0x0A, 0x0A, 0x04, 0x04, 
  
  /* character 0x57 ('W'): (width=5) */
  0x15, 0x15, 0x0A, 0x0A, 0x0A, 
  
  /* character 0x58 ('X'): (width=4) */
  0x09, 0x09, 0x06, 0x09, 0x09, 
  
  /* character 0x59 ('Y'): (width=5) */
  0x11, 0x0A, 0x04, 0x04, 0x04, 
  
  /* character 0x5A ('Z'): (width=4) */
  0x0F, 0x04, 0x02, 0x01, 0x0F, 
  
  /* character 0x5B ('['): (width=2) */
  0x03, 0x01, 0x01, 0x01, 0x03, 
  
  /* character 0x5C ('\'): (width=5) */
  0x01, 0x02, 0x04, 0x08, 0x10, 
  
  /* character 0x5D (']'): (width=2) */
  0x03, 0x02, 0x02, 0x02, 0x03, 
  
  /* character 0x5E ('^'): (width=5) */
  0x04, 0x0A, 0x11, 0x00, 0x00, 
  
  /* character 0x5F ('_'): (width=4) */
  0x00, 0x00, 0x00, 0x00, 0x0F, 
  
  /* character 0x60 ('`'): (width=1) */
  0x01, 0x01, 0x00, 0x00, 0x00, 
  
  /* character 0x61 ('a'): (width=5) */
  0x04, 0x04, 0x0A, 0x0E, 0x11, 
  
  /* character 0x62 ('b'): (width=4) */
  0x07, 0x09, 0x07, 0x09, 0x07, 
  
  /* character 0x63 ('c'): (width=4) */
  0x06, 0x09, 0x01, 0x09, 0x06, 
  
  /* character 0x64 ('d'): (width=4) */
  0x07, 0x09, 0x09, 0x09, 0x07, 
  
  /* character 0x65 ('e'): (width=4) */
  0x0F, 0x01, 0x07, 0x01, 0x0F, 
  
  /* character 0x66 ('f'): (width=4) */
  0x0F, 0x01, 0x07, 0x01, 0x01, 
  
  /* character 0x67 ('g'): (width=4) */
  0x06, 0x01, 0x0D, 0x09, 0x06, 
  
  /* character 0x68 ('h'): (width=4) */
  0x09, 0x09, 0x0F, 0x09, 0x09, 
  
  /* character 0x69 ('i'): (width=3) */
  0x07, 0x02, 0x02, 0x02, 0x07, 
  
  /* character 0x6A ('j'): (width=4) */
  0x08, 0x08, 0x08, 0x09, 0x06, 
  
  /* character 0x6B ('k'): (width=4) */
  0x09, 0x05, 0x03, 0x05, 0x09, 
  
  /* character 0x6C ('l'): (width=4) */
  0x01, 0x01, 0x01, 0x01, 0x0F, 
  
  /* character 0x6D ('m'): (width=5) */
  0x11, 0x1B, 0x15, 0x11, 0x11, 
  
  /* character 0x6E ('n'): (width=5) */
  0x11, 0x13, 0x15, 0x19, 0x11, 
  
  /* character 0x6F ('o'): (width=4) */
  0x06, 0x09, 0x09, 0x09, 0x06, 
  
  /* character 0x70 ('p'): (width=4) */
  0x07, 0x09, 0x07, 0x01, 0x01, 
  
  /* character 0x71 ('q'): (width=5) */
  0x06, 0x09, 0x09, 0x09, 0x1E, 
  
  /* character 0x72 ('r'): (width=4) */
  0x07, 0x09, 0x07, 0x09, 0x09, 
  
  /* character 0x73 ('s'): (width=4) */
  0x0E, 0x01, 0x06, 0x08, 0x07, 
  
  /* character 0x74 ('t'): (width=3) */
  0x07, 0x02, 0x02, 0x02, 0x02, 
  
  /* character 0x75 ('u'): (width=4) */
  0x09, 0x09, 0x09, 0x09, 0x06, 
  
  /* character 0x76 ('v'): (width=5) */
  0x11, 0x0A, 0x0A, 0x04, 0x04, 
  
  /* character 0x77 ('w'): (width=5) */
  0x15, 0x15, 0x0A, 0x0A, 0x0A, 
  
  /* character 0x78 ('x'): (width=4) */
  0x09, 0x09, 0x06, 0x09, 0x09, 
  
  /* character 0x79 ('y'): (width=5) */
  0x11, 0x0A, 0x04, 0x04, 0x04, 
  
  /* character 0x7A ('z'): (width=4) */
  0x0F, 0x04, 0x02, 0x01, 0x0F, 
  
  /* character 0x7B ('{'): (width=3) */
  0x00, 0x00, 0x00, 0x00, 0x00, 
  
  /* character 0x7C ('|'): (width=1) */
  0x01, 0x01, 0x01, 0x01, 0x01, 
  
  /* character 0x7D ('}'): (width=3) */
  0x00, 0x00, 0x00, 0x00, 0x00, 
};

const unsigned char MetaWatch5width[PRINTABLE_CHARACTERS] = 
{
/*		width    char    hexcode */
/*		=====    ====    ======= */
        2, /*  '  '    20      */
  		  1, /*   !      21      */
  		  3, /*   "      22      */
  		  5, /*   #      23      */
  		  3, /*   $      24      */
  		  3, /*   %      25      */
  		  5, /*   &      26      */
  		  1, /*   '      27      */
  		  2, /*   (      28      */
  		  2, /*   )      29      */
  		  5, /*   *      2A      */
  		  5, /*   +      2B      */
  		  1, /*   ,      2C      */
  		  3, /*   -      2D      */
  		  1, /*   .      2E      */
  		  5, /*   /      2F      */
  		  4, /*   0      30      */
  		  3, /*   1      31      */
  		  4, /*   2      32      */
  		  4, /*   3      33      */
  		  4, /*   4      34      */
  		  4, /*   5      35      */
  		  4, /*   6      36      */
  		  4, /*   7      37      */
  		  4, /*   8      38      */
  		  4, /*   9      39      */
  		  1, /*   :      3A      */
  		  2, /*   ;      3B      */
  		  3, /*   <      3C      */
  		  4, /*   =      3D      */
  		  3, /*   >      3E      */
  		  3, /*   ?      3F      */
  		  3, /*   @      40      */
  		  5, /*   A      41      */
  		  4, /*   B      42      */
  		  4, /*   C      43      */
  		  4, /*   D      44      */
  		  4, /*   E      45      */
  		  4, /*   F      46      */
  		  4, /*   G      47      */
  		  4, /*   H      48      */
  		  3, /*   I      49      */
  		  4, /*   J      4A      */
  		  4, /*   K      4B      */
  		  4, /*   L      4C      */
  		  5, /*   M      4D      */
  		  5, /*   N      4E      */
  		  4, /*   O      4F      */
  		  4, /*   P      50      */
  		  5, /*   Q      51      */
  		  4, /*   R      52      */
  		  4, /*   S      53      */
  		  3, /*   T      54      */
  		  4, /*   U      55      */
  		  5, /*   V      56      */
  		  5, /*   W      57      */
  		  4, /*   X      58      */
  		  5, /*   Y      59      */
  		  4, /*   Z      5A      */
  		  2, /*   [      5B      */
  		  5, /*   \      5C      */
  		  2, /*   ]      5D      */
  		  5, /*   ^      5E      */
  		  4, /*   _      5F      */
  		  1, /*   `      60      */
  		  5, /*   a      61      */
  		  4, /*   b      62      */
  		  4, /*   c      63      */
  		  4, /*   d      64      */
  		  4, /*   e      65      */
  		  4, /*   f      66      */
  		  4, /*   g      67      */
  		  4, /*   h      68      */
  		  3, /*   i      69      */
  		  4, /*   j      6A      */
  		  4, /*   k      6B      */
  		  4, /*   l      6C      */
  		  5, /*   m      6D      */
  		  5, /*   n      6E      */
  		  4, /*   o      6F      */
  		  4, /*   p      70      */
  		  5, /*   q      71      */
  		  4, /*   r      72      */
  		  4, /*   s      73      */
  		  3, /*   t      74      */
  		  4, /*   u      75      */
  		  5, /*   v      76      */
  		  5, /*   w      77      */
  		  4, /*   x      78      */
  		  5, /*   y      79      */
  		  4, /*   z      7A      */
  		  3, /*   {      7B      */
  		  1, /*   |      7C      */
  		  3, /*   }      7D      */
};

const unsigned char MetaWatch7table[PRINTABLE_CHARACTERS][7] = 
{

  /* character 0x20 (' '): (width = 2) */
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

  /* character 0x21 ('!'): (width=1) */
  0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 
  
  /* character 0x22 ('"'): (width=3) */
  0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 
  
  /* character 0x23 ('#'): (width=7) */
  0x00, 0x28, 0x7E, 0x14, 0x3F, 0x0A, 0x00, 
  
  /* character 0x24 ('$'): (width=5) */
  0x04, 0x1E, 0x05, 0x0E, 0x14, 0x0F, 0x04, 
  
  /* character 0x25 ('%'): (width=7) */
  0x42, 0x25, 0x15, 0x2A, 0x54, 0x52, 0x21, 
  
  /* character 0x26 ('&'): (width=5) */
  0x02, 0x05, 0x05, 0x02, 0x15, 0x09, 0x16, 
  
  /* character 0x27 ('''): (width=3) */
  0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 
  
  /* character 0x28 ('('): (width=3) */
  0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x04, 
  
  /* character 0x29 (')'): (width=3) */
  0x01, 0x02, 0x04, 0x04, 0x04, 0x02, 0x01, 
  
  /* character 0x2A ('*'): (width=7) */
  0x08, 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x08, 
  
  /* character 0x2B ('+'): (width=5) */
  0x00, 0x04, 0x04, 0x1F, 0x04, 0x04, 0x00, 
  
  /* character 0x2C (','): (width=1) */
  0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 
  
  /* character 0x2D ('-'): (width=4) */
  0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 
  
  /* character 0x2E ('.'): (width=1) */
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 
  
  /* character 0x2F ('/'): (width=4) */
  0x08, 0x08, 0x04, 0x06, 0x02, 0x01, 0x01, 
  
  /* character 0x30 ('0'): (width=4) */
  0x06, 0x09, 0x09, 0x09, 0x09, 0x09, 0x06, 
  
  /* character 0x31 ('1'): (width=2) */
  0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 
  
  /* character 0x32 ('2'): (width=4) */
  0x06, 0x09, 0x08, 0x04, 0x02, 0x01, 0x0F, 
  
  /* character 0x33 ('3'): (width=4) */
  0x06, 0x09, 0x08, 0x06, 0x08, 0x09, 0x06, 
  
  /* character 0x34 ('4'): (width=5) */
  0x04, 0x04, 0x0A, 0x09, 0x1F, 0x08, 0x08, 
  
  /* character 0x35 ('5'): (width=4) */
  0x0F, 0x01, 0x07, 0x08, 0x08, 0x09, 0x06, 
  
  /* character 0x36 ('6'): (width=4) */
  0x06, 0x01, 0x07, 0x09, 0x09, 0x09, 0x06, 
  
  /* character 0x37 ('7'): (width=4) */
  0x0F, 0x08, 0x04, 0x04, 0x02, 0x02, 0x02, 
  
  /* character 0x38 ('8'): (width=4) */
  0x06, 0x09, 0x09, 0x06, 0x09, 0x09, 0x06, 
  
  /* character 0x39 ('9'): (width=4) */
  0x06, 0x09, 0x09, 0x09, 0x0E, 0x08, 0x06, 
  
  /* character 0x3A (':'): (width=1) */
  0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 
  
  /* character 0x3B (';'): (width=1) */
  0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 
  
  /* character 0x3C ('<'): (width=3) */
  0x00, 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, 
  
  /* character 0x3D ('='): (width=4) */
  0x00, 0x00, 0x0F, 0x00, 0x0F, 0x00, 0x00, 
  
  /* character 0x3E ('>'): (width=3) */
  0x00, 0x01, 0x02, 0x04, 0x02, 0x01, 0x00, 
  
  /* character 0x3F ('?'): (width=4) */
  0x07, 0x08, 0x04, 0x02, 0x02, 0x00, 0x02, 
  
  /* character 0x40 ('@'): (width=7) */
  0x3C, 0x42, 0x59, 0x55, 0x39, 0x02, 0x3C, 
  
  /* character 0x41 ('A'): (width=7) */
  0x08, 0x08, 0x14, 0x14, 0x3E, 0x22, 0x41, 
  
  /* character 0x42 ('B'): (width=5) */
  0x0F, 0x11, 0x11, 0x0F, 0x11, 0x11, 0x0F, 
  
  /* character 0x43 ('C'): (width=5) */
  0x0C, 0x12, 0x01, 0x01, 0x01, 0x12, 0x0C, 
  
  /* character 0x44 ('D'): (width=5) */
  0x07, 0x09, 0x11, 0x11, 0x11, 0x09, 0x07, 
  
  /* character 0x45 ('E'): (width=4) */
  0x0F, 0x01, 0x01, 0x07, 0x01, 0x01, 0x0F, 
  
  /* character 0x46 ('F'): (width=4) */
  0x0F, 0x01, 0x01, 0x07, 0x01, 0x01, 0x01, 
  
  /* character 0x47 ('G'): (width=6) */
  0x0C, 0x12, 0x01, 0x39, 0x21, 0x12, 0x0C, 
  
  /* character 0x48 ('H'): (width=5) */
  0x11, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x11, 
  
  /* character 0x49 ('I'): (width=3) */
  0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07, 
  
  /* character 0x4A ('J'): (width=5) */
  0x10, 0x10, 0x10, 0x10, 0x10, 0x11, 0x0E, 
  
  /* character 0x4B ('K'): (width=5) */
  0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11, 
  
  /* character 0x4C ('L'): (width=4) */
  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, 
  
  /* character 0x4D ('M'): (width=7) */
  0x41, 0x63, 0x63, 0x55, 0x55, 0x49, 0x49, 
  
  /* character 0x4E ('N'): (width=6) */
  0x21, 0x23, 0x25, 0x2D, 0x29, 0x31, 0x21, 
  
  /* character 0x4F ('O'): (width=6) */
  0x0C, 0x12, 0x21, 0x21, 0x21, 0x12, 0x0C, 
  
  /* character 0x50 ('P'): (width=4) */
  0x07, 0x09, 0x09, 0x07, 0x01, 0x01, 0x01, 
  
  /* character 0x51 ('Q'): (width=7) */
  0x0C, 0x12, 0x21, 0x21, 0x21, 0x12, 0x6C, 
  
  /* character 0x52 ('R'): (width=5) */
  0x0F, 0x11, 0x11, 0x0F, 0x09, 0x11, 0x11, 
  
  /* character 0x53 ('S'): (width=4) */
  0x06, 0x09, 0x01, 0x06, 0x08, 0x09, 0x06, 
  
  /* character 0x54 ('T'): (width=5) */
  0x1F, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
  
  /* character 0x55 ('U'): (width=5) */
  0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0E, 
  
  /* character 0x56 ('V'): (width=7) */
  0x41, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 
  
  /* character 0x57 ('W'): (width=7) */
  0x49, 0x49, 0x49, 0x55, 0x55, 0x22, 0x22, 
  
  /* character 0x58 ('X'): (width=5) */
  0x11, 0x1B, 0x0A, 0x04, 0x0A, 0x1B, 0x11, 
  
  /* character 0x59 ('Y'): (width=7) */
  0x41, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 
  
  /* character 0x5A ('Z'): (width=5) */
  0x1F, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1F, 
  
  /* character 0x5B ('['): (width=3) */
  0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, 
  
  /* character 0x5C ('\'): (width=4) */
  0x01, 0x01, 0x02, 0x06, 0x04, 0x08, 0x08, 
  
  /* character 0x5D (']'): (width=3) */
  0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07, 
  
  /* character 0x5E ('^'): (width=5) */
  0x04, 0x0A, 0x11, 0x00, 0x00, 0x00, 0x00, 
  
  /* character 0x5F ('_'): (width=5) */
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 
  
  /* character 0x60 ('`'): (width=1) */
  0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
  
  /* character 0x61 ('a'): (width=7) */
  0x08, 0x08, 0x14, 0x14, 0x3E, 0x22, 0x41, 
  
  /* character 0x62 ('b'): (width=5) */
  0x0F, 0x11, 0x11, 0x0F, 0x11, 0x11, 0x0F, 
  
  /* character 0x63 ('c'): (width=5) */
  0x0C, 0x12, 0x01, 0x01, 0x01, 0x12, 0x0C, 
  
  /* character 0x64 ('d'): (width=5) */
  0x07, 0x09, 0x11, 0x11, 0x11, 0x09, 0x07, 
  
  /* character 0x65 ('e'): (width=4) */
  0x0F, 0x01, 0x01, 0x07, 0x01, 0x01, 0x0F, 
  
  /* character 0x66 ('f'): (width=4) */
  0x0F, 0x01, 0x01, 0x07, 0x01, 0x01, 0x01, 
  
  /* character 0x67 ('g'): (width=6) */
  0x0C, 0x12, 0x01, 0x39, 0x21, 0x12, 0x0C, 
  
  /* character 0x68 ('h'): (width=5) */
  0x11, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x11, 
  
  /* character 0x69 ('i'): (width=3) */
  0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07, 
  
  /* character 0x6A ('j'): (width=5) */
  0x10, 0x10, 0x10, 0x10, 0x10, 0x11, 0x0E, 
  
  /* character 0x6B ('k'): (width=5) */
  0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11, 
  
  /* character 0x6C ('l'): (width=4) */
  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, 
  
  /* character 0x6D ('m'): (width=7) */
  0x41, 0x63, 0x63, 0x55, 0x55, 0x49, 0x49, 
  
  /* character 0x6E ('n'): (width=6) */
  0x21, 0x23, 0x25, 0x2D, 0x29, 0x31, 0x21, 
  
  /* character 0x6F ('o'): (width=6) */
  0x0C, 0x12, 0x21, 0x21, 0x21, 0x12, 0x0C, 
  
  /* character 0x70 ('p'): (width=4) */
  0x07, 0x09, 0x09, 0x07, 0x01, 0x01, 0x01, 
  
  /* character 0x71 ('q'): (width=7) */
  0x0C, 0x12, 0x21, 0x21, 0x21, 0x12, 0x6C, 
  
  /* character 0x72 ('r'): (width=5) */
  0x0F, 0x11, 0x11, 0x0F, 0x09, 0x11, 0x11, 
  
  /* character 0x73 ('s'): (width=4) */
  0x06, 0x09, 0x01, 0x06, 0x08, 0x09, 0x06, 
  
  /* character 0x74 ('t'): (width=5) */
  0x1F, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
  
  /* character 0x75 ('u'): (width=5) */
  0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0E, 
  
  /* character 0x76 ('v'): (width=7) */
  0x41, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 
  
  /* character 0x77 ('w'): (width=7) */
  0x49, 0x49, 0x49, 0x55, 0x55, 0x22, 0x22, 
  
  /* character 0x78 ('x'): (width=5) */
  0x11, 0x1B, 0x0A, 0x04, 0x0A, 0x1B, 0x11, 
  
  /* character 0x79 ('y'): (width=7) */
  0x41, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 
  
  /* character 0x7A ('z'): (width=5) */
  0x1F, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1F, 
  
  /* character 0x7B ('{'): (width=3) */
  0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x04, 
  
  /* character 0x7C ('|'): (width=1) */
  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
  
  /* character 0x7D ('}'): (width=3) */
  0x01, 0x02, 0x04, 0x04, 0x04, 0x02, 0x01, 

};

const unsigned char MetaWatch7width[PRINTABLE_CHARACTERS] = {
/*		width    char    hexcode */
/*		=====    ====    ======= */
        2, /*  '  '    20      */
  		  1, /*   !      21      */
  		  3, /*   "      22      */
  		  7, /*   #      23      */
  		  5, /*   $      24      */
  		  7, /*   %      25      */
  		  5, /*   &      26      */
  		  3, /*   '      27      */
  		  3, /*   (      28      */
  		  3, /*   )      29      */
  		  7, /*   *      2A      */
  		  5, /*   +      2B      */
  		  1, /*   ,      2C      */
  		  4, /*   -      2D      */
  		  1, /*   .      2E      */
  		  4, /*   /      2F      */
  		  4, /*   0      30      */
  		  2, /*   1      31      */
  		  4, /*   2      32      */
  		  4, /*   3      33      */
  		  5, /*   4      34      */
  		  4, /*   5      35      */
  		  4, /*   6      36      */
  		  4, /*   7      37      */
  		  4, /*   8      38      */
  		  4, /*   9      39      */
  		  1, /*   :      3A      */
  		  1, /*   ;      3B      */
  		  3, /*   <      3C      */
  		  4, /*   =      3D      */
  		  3, /*   >      3E      */
  		  4, /*   ?      3F      */
  		  7, /*   @      40      */
  		  7, /*   A      41      */
  		  5, /*   B      42      */
  		  5, /*   C      43      */
  		  5, /*   D      44      */
  		  4, /*   E      45      */
  		  4, /*   F      46      */
  		  6, /*   G      47      */
  		  5, /*   H      48      */
  		  3, /*   I      49      */
  		  5, /*   J      4A      */
  		  5, /*   K      4B      */
  		  4, /*   L      4C      */
  		  7, /*   M      4D      */
  		  6, /*   N      4E      */
  		  6, /*   O      4F      */
  		  4, /*   P      50      */
  		  7, /*   Q      51      */
  		  5, /*   R      52      */
  		  4, /*   S      53      */
  		  5, /*   T      54      */
  		  5, /*   U      55      */
  		  7, /*   V      56      */
  		  7, /*   W      57      */
  		  5, /*   X      58      */
  		  7, /*   Y      59      */
  		  5, /*   Z      5A      */
  		  3, /*   [      5B      */
  		  4, /*   \      5C      */
  		  3, /*   ]      5D      */
  		  5, /*   ^      5E      */
  		  5, /*   _      5F      */
  		  1, /*   `      60      */
  		  7, /*   a      61      */
  		  5, /*   b      62      */
  		  5, /*   c      63      */
  		  5, /*   d      64      */
  		  4, /*   e      65      */
  		  4, /*   f      66      */
  		  6, /*   g      67      */
  		  5, /*   h      68      */
  		  3, /*   i      69      */
  		  5, /*   j      6A      */
  		  5, /*   k      6B      */
  		  4, /*   l      6C      */
  		  7, /*   m      6D      */
  		  6, /*   n      6E      */
  		  6, /*   o      6F      */
  		  4, /*   p      70      */
  		  7, /*   q      71      */
  		  5, /*   r      72      */
  		  4, /*   s      73      */
  		  5, /*   t      74      */
  		  5, /*   u      75      */
  		  7, /*   v      76      */
  		  7, /*   w      77      */
  		  5, /*   x      78      */
  		  7, /*   y      79      */
  		  5, /*   z      7A      */
  		  3, /*   {      7B      */
  		  1, /*   |      7C      */
  		  3, /*   }      7D      */
};


const unsigned int MetaWatch16table[PRINTABLE_CHARACTERS][16] = 
{
  /* character 0x20 (' '): (width=4) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x21 ('!'): (width=2) */
  0x0000, 0x0000, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0000, 0x0003, 
  0x0003, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x22 ('"'): (width=5) */
  0x0000, 0x0012, 0x001B, 0x001B, 
  0x0009, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x23 ('#'): (width=12) */
  0x0000, 0x0000, 0x0000, 0x0110, 
  0x0198, 0x0FFE, 0x07FF, 0x0198, 
  0x0198, 0x0FFE, 0x07FF, 0x0198, 
  0x0088, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x24 ('$'): (width=6) */
  0x000C, 0x000C, 0x001E, 0x003F, 
  0x0033, 0x0003, 0x0007, 0x001E, 
  0x0038, 0x0030, 0x0033, 0x003F, 
  0x001E, 0x000C, 0x000C, 0x0000, 
  
  /* character 0x25 ('%'): (width=10) */
  0x0000, 0x020E, 0x031F, 0x039B, 
  0x01DF, 0x00EE, 0x0070, 0x0038, 
  0x01DC, 0x03EE, 0x0367, 0x03E3, 
  0x01C1, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x26 ('&'): (width=10) */
  0x0000, 0x0000, 0x001C, 0x003E, 
  0x0036, 0x003E, 0x001C, 0x01BE, 
  0x01F7, 0x00E3, 0x01F7, 0x03BE, 
  0x031C, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x27 ('''): (width=2) */
  0x0000, 0x0002, 0x0003, 0x0003, 
  0x0001, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x28 ('('): (width=4) */
  0x0008, 0x0004, 0x0006, 0x0006, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0003, 0x0006, 
  0x0006, 0x0004, 0x0008, 0x0000, 
  
  /* character 0x29 (')'): (width=4) */
  0x0001, 0x0002, 0x0006, 0x0006, 
  0x000C, 0x000C, 0x000C, 0x000C, 
  0x000C, 0x000C, 0x000C, 0x0006, 
  0x0006, 0x0002, 0x0001, 0x0000, 
  
  /* character 0x2A ('*'): (width=8) */
  0x0000, 0x0000, 0x0018, 0x0018, 
  0x00DB, 0x00FF, 0x003C, 0x00FF, 
  0x00DB, 0x0018, 0x0018, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x2B ('+'): (width=8) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0018, 0x0018, 0x0018, 0x00FF, 
  0x00FF, 0x0018, 0x0018, 0x0018, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x2C (','): (width=2) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0002, 
  0x0003, 0x0003, 0x0001, 0x0000, 
  
  /* character 0x2D ('-'): (width=8) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x00FF, 
  0x00FF, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x2E ('.'): (width=2) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0003, 
  0x0003, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x2F ('/'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0030, 
  0x0030, 0x0018, 0x0018, 0x000C, 
  0x000C, 0x0006, 0x0006, 0x0003, 
  0x0003, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x30 ('0'): (width=7) */
  0x0000, 0x0000, 0x001C, 0x003E, 
  0x0036, 0x0063, 0x0063, 0x0063, 
  0x0063, 0x0063, 0x0036, 0x003E, 
  0x001C, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x31 ('1'): (width=3) */
  0x0000, 0x0000, 0x0006, 0x0007, 
  0x0007, 0x0006, 0x0006, 0x0006, 
  0x0006, 0x0006, 0x0006, 0x0006, 
  0x0006, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x32 ('2'): (width=6) */
  0x0000, 0x0000, 0x001E, 0x003F, 
  0x0033, 0x0030, 0x0038, 0x001C, 
  0x000E, 0x0007, 0x0003, 0x003F, 
  0x003F, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x33 ('3'): (width=6) */
  0x0000, 0x0000, 0x001E, 0x003F, 
  0x0033, 0x0030, 0x001C, 0x003C, 
  0x0030, 0x0030, 0x0033, 0x003F, 
  0x001E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x34 ('4'): (width=7) */
  0x0000, 0x0000, 0x000C, 0x000C, 
  0x000C, 0x0036, 0x0036, 0x0033, 
  0x007F, 0x007F, 0x0030, 0x0030, 
  0x0030, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x35 ('5'): (width=6) */
  0x0000, 0x0000, 0x003F, 0x003F, 
  0x0003, 0x0003, 0x001F, 0x003F, 
  0x0030, 0x0030, 0x0033, 0x003F, 
  0x001E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x36 ('6'): (width=6) */
  0x0000, 0x0000, 0x000C, 0x000E, 
  0x0006, 0x0003, 0x001F, 0x003F, 
  0x0033, 0x0033, 0x0033, 0x001F, 
  0x001E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x37 ('7'): (width=6) */
  0x0000, 0x0000, 0x003F, 0x003F, 
  0x0030, 0x0030, 0x0018, 0x0018, 
  0x000C, 0x000C, 0x000C, 0x000C, 
  0x000C, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x38 ('8'): (width=6) */
  0x0000, 0x0000, 0x001E, 0x003F, 
  0x0033, 0x0033, 0x003F, 0x001E, 
  0x0033, 0x0033, 0x0033, 0x003F, 
  0x001E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x39 ('9'): (width=6) */
  0x0000, 0x0000, 0x001E, 0x003F, 
  0x0033, 0x0033, 0x0033, 0x003F, 
  0x003E, 0x0030, 0x0018, 0x001C, 
  0x000C, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x3A (':'): (width=2) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0003, 0x0003, 0x0000, 
  0x0000, 0x0003, 0x0003, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x3B (';'): (width=2) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0003, 0x0003, 0x0000, 
  0x0002, 0x0003, 0x0003, 0x0001, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x3C ('<'): (width=8) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x00C0, 0x00F0, 0x003C, 0x000F, 
  0x003C, 0x00F0, 0x00C0, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x3D ('='): (width=7) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x007F, 0x007F, 
  0x0000, 0x007F, 0x007F, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x3E ('>'): (width=8) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0003, 0x000F, 0x003C, 0x00F0, 
  0x003C, 0x000F, 0x0003, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x3F ('?'): (width=6) */
  0x0000, 0x0000, 0x001E, 0x003F, 
  0x0033, 0x0030, 0x0018, 0x001C, 
  0x000C, 0x000C, 0x0000, 0x000C, 
  0x000C, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x40 ('@'): (width=11) */
  0x0000, 0x0000, 0x01F8, 0x03FE, 
  0x0706, 0x06F3, 0x06FB, 0x06DB, 
  0x07FB, 0x03F3, 0x0006, 0x01FE, 
  0x00F8, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x41 ('A'): (width=9) */
  0x0000, 0x0000, 0x0010, 0x0010, 
  0x0038, 0x0038, 0x006C, 0x006C, 
  0x00C6, 0x00C6, 0x01FF, 0x0183, 
  0x0183, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x42 ('B'): (width=7) */
  0x0000, 0x0000, 0x003F, 0x007F, 
  0x0063, 0x0063, 0x003F, 0x007F, 
  0x0063, 0x0063, 0x0063, 0x007F, 
  0x003F, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x43 ('C'): (width=7) */
  0x0000, 0x0000, 0x003E, 0x007F, 
  0x0063, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0063, 0x007F, 
  0x003E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x44 ('D'): (width=7) */
  0x0000, 0x0000, 0x003F, 0x007F, 
  0x0063, 0x0063, 0x0063, 0x0063, 
  0x0063, 0x0063, 0x0063, 0x007F, 
  0x003F, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x45 ('E'): (width=7) */
  0x0000, 0x0000, 0x007F, 0x007F, 
  0x0003, 0x0003, 0x001F, 0x001F, 
  0x0003, 0x0003, 0x0003, 0x007F, 
  0x007F, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x46 ('F'): (width=6) */
  0x0000, 0x0000, 0x003F, 0x003F, 
  0x0003, 0x0003, 0x003F, 0x003F, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x47 ('G'): (width=7) */
  0x0000, 0x0000, 0x003E, 0x007F, 
  0x0063, 0x0003, 0x0003, 0x007B, 
  0x007B, 0x0063, 0x0063, 0x007F, 
  0x003E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x48 ('H'): (width=7) */
  0x0000, 0x0000, 0x0063, 0x0063, 
  0x0063, 0x0063, 0x007F, 0x007F, 
  0x0063, 0x0063, 0x0063, 0x0063, 
  0x0063, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x49 ('I'): (width=4) */
  0x0000, 0x0000, 0x000F, 0x000F, 
  0x0006, 0x0006, 0x0006, 0x0006, 
  0x0006, 0x0006, 0x0006, 0x000F, 
  0x000F, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x4A ('J'): (width=6) */
  0x0000, 0x0000, 0x0030, 0x0030, 
  0x0030, 0x0030, 0x0030, 0x0030, 
  0x0030, 0x0030, 0x0033, 0x003F, 
  0x001E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x4B ('K'): (width=7) */
  0x0000, 0x0000, 0x0063, 0x0073, 
  0x003B, 0x001F, 0x000F, 0x0007, 
  0x000F, 0x001F, 0x003B, 0x0073, 
  0x0063, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x4C ('L'): (width=6) */
  0x0000, 0x0000, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0003, 0x003F, 
  0x003F, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x4D ('M'): (width=11) */
  0x0000, 0x0000, 0x0401, 0x0603, 
  0x0707, 0x078F, 0x07DF, 0x06FB, 
  0x0673, 0x0623, 0x0603, 0x0603, 
  0x0603, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x4E ('N'): (width=9) */
  0x0000, 0x0000, 0x0181, 0x0183, 
  0x0187, 0x018F, 0x019F, 0x01BB, 
  0x01F3, 0x01E3, 0x01C3, 0x0183, 
  0x0103, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x4F ('O'): (width=7) */
  0x0000, 0x0000, 0x003E, 0x007F, 
  0x0063, 0x0063, 0x0063, 0x0063, 
  0x0063, 0x0063, 0x0063, 0x007F, 
  0x003E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x50 ('P'): (width=7) */
  0x0000, 0x0000, 0x003F, 0x007F, 
  0x0063, 0x0063, 0x0063, 0x007F, 
  0x003F, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x51 ('Q'): (width=8) */
  0x0000, 0x0000, 0x003E, 0x007F, 
  0x0063, 0x0063, 0x0063, 0x0063, 
  0x0063, 0x0063, 0x0063, 0x007F, 
  0x003E, 0x00F0, 0x0060, 0x0000, 
  
  /* character 0x52 ('R'): (width=7) */
  0x0000, 0x0000, 0x003F, 0x007F, 
  0x0063, 0x0063, 0x0063, 0x003F, 
  0x007F, 0x0063, 0x0063, 0x0063, 
  0x0063, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x53 ('S'): (width=6) */
  0x0000, 0x0000, 0x001E, 0x003F, 
  0x0033, 0x0003, 0x0007, 0x001E, 
  0x0038, 0x0030, 0x0033, 0x003F, 
  0x001E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x54 ('T'): (width=6) */
  0x0000, 0x0000, 0x003F, 0x003F, 
  0x000C, 0x000C, 0x000C, 0x000C, 
  0x000C, 0x000C, 0x000C, 0x000C, 
  0x000C, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x55 ('U'): (width=7) */
  0x0000, 0x0000, 0x0063, 0x0063, 
  0x0063, 0x0063, 0x0063, 0x0063, 
  0x0063, 0x0063, 0x0063, 0x007F, 
  0x003E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x56 ('V'): (width=7) */
  0x0000, 0x0000, 0x0063, 0x0063, 
  0x0063, 0x0036, 0x0036, 0x0036, 
  0x001C, 0x001C, 0x001C, 0x0008, 
  0x0008, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x57 ('W'): (width=11) */
  0x0000, 0x0000, 0x0603, 0x0623, 
  0x0623, 0x0376, 0x0376, 0x0376, 
  0x01DC, 0x01DC, 0x01DC, 0x0088, 
  0x0088, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x58 ('X'): (width=7) */
  0x0000, 0x0000, 0x0063, 0x0063, 
  0x0036, 0x0036, 0x001C, 0x001C, 
  0x001C, 0x0036, 0x0036, 0x0063, 
  0x0063, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x59 ('Y'): (width=8) */
  0x0000, 0x0000, 0x00C3, 0x00C3, 
  0x0066, 0x0066, 0x003C, 0x003C, 
  0x0018, 0x0018, 0x0018, 0x0018, 
  0x0018, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x5A ('Z'): (width=7) */
  0x0000, 0x0000, 0x007F, 0x007F, 
  0x0030, 0x0030, 0x0018, 0x0018, 
  0x000C, 0x000E, 0x0006, 0x007F, 
  0x007F, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x5B ('['): (width=4) */
  0x000F, 0x000F, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x000F, 0x000F, 0x0000, 
  
  /* character 0x5C ('\'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0003, 
  0x0003, 0x0006, 0x0006, 0x000C, 
  0x000C, 0x0018, 0x0018, 0x0030, 
  0x0030, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x5D (']'): (width=4) */
  0x000F, 0x000F, 0x000C, 0x000C, 
  0x000C, 0x000C, 0x000C, 0x000C, 
  0x000C, 0x000C, 0x000C, 0x000C, 
  0x000C, 0x000F, 0x000F, 0x0000, 
  
  /* character 0x5E ('^'): (width=7) */
  0x0000, 0x0000, 0x0000, 0x0008, 
  0x0008, 0x001C, 0x001C, 0x0036, 
  0x0036, 0x0063, 0x0063, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x5F ('_'): (width=9) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x01FF, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x60 ('`'): (width=3) */
  0x0000, 0x0000, 0x0000, 0x0001, 
  0x0003, 0x0006, 0x0004, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x61 ('a'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x001E, 0x003F, 0x0030, 
  0x003E, 0x003F, 0x0033, 0x003F, 
  0x003E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x62 ('b'): (width=6) */
  0x0000, 0x0000, 0x0003, 0x0003, 
  0x0003, 0x001F, 0x003F, 0x0033, 
  0x0033, 0x0033, 0x0033, 0x003F, 
  0x001F, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x63 ('c'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x001E, 0x003F, 0x0033, 
  0x0003, 0x0003, 0x0033, 0x003F, 
  0x001E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x64 ('d'): (width=6) */
  0x0000, 0x0000, 0x0030, 0x0030, 
  0x0030, 0x003E, 0x003F, 0x0033, 
  0x0033, 0x0033, 0x0033, 0x003F, 
  0x003E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x65 ('e'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x001E, 0x003F, 0x0033, 
  0x003F, 0x003F, 0x0003, 0x003F, 
  0x001E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x66 ('f'): (width=4) */
  0x0000, 0x0000, 0x000C, 0x000E, 
  0x0006, 0x000F, 0x000F, 0x0006, 
  0x0006, 0x0006, 0x0006, 0x0006, 
  0x0006, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x67 ('g'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x003E, 0x003F, 0x0033, 
  0x0033, 0x0033, 0x0033, 0x003F, 
  0x003E, 0x0030, 0x003E, 0x001C, 
  
  /* character 0x68 ('h'): (width=6) */
  0x0000, 0x0000, 0x0003, 0x0003, 
  0x0003, 0x001F, 0x003F, 0x0033, 
  0x0033, 0x0033, 0x0033, 0x0033, 
  0x0033, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x69 ('i'): (width=2) */
  0x0000, 0x0000, 0x0003, 0x0003, 
  0x0000, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x6A ('j'): (width=5) */
  0x0000, 0x0000, 0x0018, 0x0018, 
  0x0000, 0x0018, 0x0018, 0x0018, 
  0x0018, 0x0018, 0x0018, 0x0018, 
  0x0018, 0x0018, 0x001F, 0x000E, 
  
  /* character 0x6B ('k'): (width=6) */
  0x0000, 0x0000, 0x0003, 0x0003, 
  0x0003, 0x0033, 0x003B, 0x001F, 
  0x000F, 0x000F, 0x001F, 0x003B, 
  0x0033, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x6C ('l'): (width=2) */
  0x0000, 0x0000, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x6D ('m'): (width=10) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x01DB, 0x03FF, 0x0377, 
  0x0333, 0x0333, 0x0333, 0x0333, 
  0x0333, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x6E ('n'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x001B, 0x003F, 0x0037, 
  0x0033, 0x0033, 0x0033, 0x0033, 
  0x0033, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x6F ('o'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x001E, 0x003F, 0x0033, 
  0x0033, 0x0033, 0x0033, 0x003F, 
  0x001E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x70 ('p'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x001F, 0x003F, 0x0033, 
  0x0033, 0x0033, 0x0033, 0x001F, 
  0x001F, 0x0003, 0x0003, 0x0003, 
  
  /* character 0x71 ('q'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x003E, 0x003F, 0x0033, 
  0x0033, 0x0033, 0x0033, 0x003E, 
  0x003E, 0x0030, 0x0030, 0x0030, 
  
  /* character 0x72 ('r'): (width=5) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x001B, 0x001F, 0x0007, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x73 ('s'): (width=5) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x000E, 0x001F, 0x0003, 
  0x000F, 0x001E, 0x0018, 0x001F, 
  0x000E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x74 ('t'): (width=4) */
  0x0000, 0x0000, 0x0004, 0x0006, 
  0x0006, 0x000F, 0x000F, 0x0006, 
  0x0006, 0x0006, 0x0006, 0x000E, 
  0x000C, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x75 ('u'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0033, 0x0033, 0x0033, 
  0x0033, 0x0033, 0x0033, 0x003F, 
  0x003E, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x76 ('v'): (width=7) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0063, 0x0063, 0x0036, 
  0x0036, 0x001C, 0x001C, 0x0008, 
  0x0008, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x77 ('w'): (width=11) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0623, 0x0623, 0x0376, 
  0x0376, 0x01DC, 0x01DC, 0x0088, 
  0x0088, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x78 ('x'): (width=7) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0063, 0x0077, 0x003E, 
  0x001C, 0x001C, 0x003E, 0x0077, 
  0x0063, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x79 ('y'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x0033, 0x0033, 0x0033, 
  0x0033, 0x0033, 0x0033, 0x003F, 
  0x003E, 0x0030, 0x003E, 0x001C, 
  
  /* character 0x7A ('z'): (width=6) */
  0x0000, 0x0000, 0x0000, 0x0000, 
  0x0000, 0x003F, 0x003F, 0x0030, 
  0x0018, 0x000C, 0x0006, 0x003F, 
  0x003F, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x7B ('{'): (width=4) */
  0x0008, 0x0004, 0x0006, 0x0006, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0003, 0x0006, 
  0x0006, 0x0004, 0x0008, 0x0000, 
  
  /* character 0x7C ('|'): (width=2) */
  0x0000, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0003, 0x0000, 0x0000, 
  0x0003, 0x0003, 0x0003, 0x0003, 
  0x0003, 0x0000, 0x0000, 0x0000, 
  
  /* character 0x7D ('}'): (width=4) */
  0x0001, 0x0002, 0x0006, 0x0006, 
  0x000C, 0x000C, 0x000C, 0x000C, 
  0x000C, 0x000C, 0x000C, 0x0006, 
  0x0006, 0x0002, 0x0001, 0x0000, 

};

const unsigned char MetaWatch16width[PRINTABLE_CHARACTERS] = 
{
/*		width    char    hexcode */
/*		=====    ====    ======= */
        4, /*  '  '    20      */
  		  2, /*   !      21      */
  		  5, /*   "      22      */
  		 12, /*   #      23      */
  		  6, /*   $      24      */
  		 10, /*   %      25      */
  		 10, /*   &      26      */
  		  2, /*   '      27      */
  		  4, /*   (      28      */
  		  4, /*   )      29      */
  		  8, /*   *      2A      */
  		  8, /*   +      2B      */
  		  2, /*   ,      2C      */
  		  8, /*   -      2D      */
  		  2, /*   .      2E      */
  		  6, /*   /      2F      */
  		  7, /*   0      30      */
  		  3, /*   1      31      */
  		  6, /*   2      32      */
  		  6, /*   3      33      */
  		  7, /*   4      34      */
  		  6, /*   5      35      */
  		  6, /*   6      36      */
  		  6, /*   7      37      */
  		  6, /*   8      38      */
  		  6, /*   9      39      */
  		  2, /*   :      3A      */
  		  2, /*   ;      3B      */
  		  8, /*   <      3C      */
  		  7, /*   =      3D      */
  		  8, /*   >      3E      */
  		  6, /*   ?      3F      */
  		 11, /*   @      40      */
  		  9, /*   A      41      */
  		  7, /*   B      42      */
  		  7, /*   C      43      */
  		  7, /*   D      44      */
  		  7, /*   E      45      */
  		  6, /*   F      46      */
  		  7, /*   G      47      */
  		  7, /*   H      48      */
  		  4, /*   I      49      */
  		  6, /*   J      4A      */
  		  7, /*   K      4B      */
  		  6, /*   L      4C      */
  		 11, /*   M      4D      */
  		  9, /*   N      4E      */
  		  7, /*   O      4F      */
  		  7, /*   P      50      */
  		  8, /*   Q      51      */
  		  7, /*   R      52      */
  		  6, /*   S      53      */
  		  6, /*   T      54      */
  		  7, /*   U      55      */
  		  7, /*   V      56      */
  		 11, /*   W      57      */
  		  7, /*   X      58      */
  		  8, /*   Y      59      */
  		  7, /*   Z      5A      */
  		  4, /*   [      5B      */
  		  6, /*   \      5C      */
  		  4, /*   ]      5D      */
  		  7, /*   ^      5E      */
  		  9, /*   _      5F      */
  		  3, /*   `      60      */
  		  6, /*   a      61      */
  		  6, /*   b      62      */
  		  6, /*   c      63      */
  		  6, /*   d      64      */
  		  6, /*   e      65      */
  		  4, /*   f      66      */
  		  6, /*   g      67      */
  		  6, /*   h      68      */
  		  2, /*   i      69      */
  		  5, /*   j      6A      */
  		  6, /*   k      6B      */
  		  2, /*   l      6C      */
  		 10, /*   m      6D      */
  		  6, /*   n      6E      */
  		  6, /*   o      6F      */
  		  6, /*   p      70      */
  		  6, /*   q      71      */
  		  5, /*   r      72      */
  		  5, /*   s      73      */
  		  4, /*   t      74      */
  		  6, /*   u      75      */
  		  7, /*   v      76      */
  		 11, /*   w      77      */
  		  7, /*   x      78      */
  		  6, /*   y      79      */
  		  6, /*   z      7A      */
  		  4, /*   {      7B      */
  		  2, /*   |      7C      */
  		  4, /*   }      7D      */
};